
Public Class DAOBanAn
    Public Shared Function BanAn_Load() As DataTable
        Return DataProvider.LoadTable("Select * from BanAn")
    End Function
    'load ban an
    Public Shared Sub BanAn_Insert(ByVal n As DTOBanAn)
        Dim sql As String = String.Format("insert into BanAn(TenBan,MaTT) values (N'{0}','1')", n.TenBan)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

    Public Shared Sub BanAn_Update(ByVal n As DTOBanAn)
        Dim sql As String = String.Format("update BanAn set TenBan = N'{0}', MaTT = '{1}' where MaBan = '{2}'", _
                                         n.TenBan, n.MaTT, n.MaBan)
        DataProvider.ExecuteNonQuery(sql)
    End Sub
    Public Shared Sub BanAn_Delete(ByVal n As DTOBanAn)
        If AgreeForm.deleteCaution = False Then
            Return
        End If
        Dim sql As String = String.Format("delete BanAn where MAban = '{0}'", n.MaBan)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

End Class